﻿using System;
using Guru.Web.UI;
using Guru.Data;
using System.Data;
using Guru.Utilities;

public partial class UserControl_CheckedInView : GuruUserControl
{
    protected int InvoiceID
    {
        get
        {
            return int.Parse(Page.SecureQueryString["InvoiceID"]);
        }
    }
    protected int RoomID
    {
        get
        {
            return int.Parse(Page.SecureQueryString["RoomID"]);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.LoadDetails();
        }
    }
    public void LoadDetails()
    {
        GuruParameterCollection parameters = new GuruParameterCollection();
        parameters.AddUserLoggedParams();
        parameters.Add("@InvoiceID", this.InvoiceID, DbType.Int32);
        parameters.Add("@RoomID", this.RoomID, DbType.Int32);
        DataTable tb = HSMCommon.HSMBusiness.GetDataTable("spa_HSM_Invoice_GetDetailsByRoom", parameters);

        this.uxRoomName.Text = tb.Rows[0]["RoomName"].ToSafeString();
        this.uxStartDate.Text = tb.Rows[0]["CheckInDate"].FormatDateTime();
    }
}
